// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 

package com.nnee.p_stat;

import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import android.os.Build;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.util.DisplayMetrics;
import android.view.Display;
import android.view.WindowManager;
import com.nnee.p_fk.p_b.cls_c;
import com.nnee.p_fk.p_b.cls_d;
import com.nnee.p_fk.p_b.cls_e;
import com.nnee.p_fk.m;
import com.nnee.p_pr.p_a.cls_t;
import com.nnee.p_pr.p_a.cls_u;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.Set;
import org.json.JSONException;
import org.json.JSONObject;

// Referenced classes of package com.nnee.stat:
//            b, HeartBeatAlarm

public class cls_a
    implements cls_d
{

    private cls_a()
    {
        k = new Object[0];
        l = com.nnee.p_fk.cls_m.a().c();
        m = new HashMap();
        n = new LinkedList();
    }

    public static String a()
    {
        return F;
    }

    private static String a(Context context)
    {
        String s1 = null;
        String s3 = b(context);
        String s2 = s3;
        String s4;
        if(!TextUtils.isEmpty(s2))
            break MISSING_BLOCK_LABEL_27;
        s4 = c(context);
        s2 = s4;
_L2:
        if(s2 == null)
            s2 = "";
        return s2;
        Exception exception;
        exception;
_L3:
        exception.printStackTrace();
        s2 = s1;
        if(true) goto _L2; else goto _L1
_L1:
        Exception exception1;
        exception1;
        s1 = s2;
        exception = exception1;
          goto _L3
    }

    public static void a(int i1, String s1)
    {
        JSONObject jsonobject = new JSONObject();
        try
        {
            jsonobject.put("errorCode", i1);
            jsonobject.put("errorMessage", s1);
        }
        catch(JSONException jsonexception)
        {
            jsonexception.printStackTrace();
        }
        f().a(jsonobject, "error", -1L);
    }

    public static void a(long l1)
    {
        f().a(((JSONObject) (null)), "launch", l1);
    }

    public static void a(long l1, String s1)
    {
        JSONObject jsonobject = new JSONObject();
        try
        {
            String s2 = l();
            if(s2 != null)
                jsonobject.put("ip", s2);
            String s3 = f(f().p);
            if(s3 != null)
                jsonobject.put("mno", s3);
            String s4 = g(f().p);
            if(s4 != null)
                jsonobject.put("network", s4);
            jsonobject.put("account", s1);
        }
        catch(JSONException jsonexception)
        {
            jsonexception.printStackTrace();
        }
        c();
        f().s = s1;
        f().a(jsonobject, "login", l1);
    }

    public static void a(long l1, String s1, String s2)
    {
        JSONObject jsonobject = new JSONObject();
        try
        {
            jsonobject.put("update_ver", s1);
            jsonobject.put("old_ver", s2);
        }
        catch(JSONException jsonexception)
        {
            jsonexception.printStackTrace();
        }
        f().a(jsonobject, "autoupdate", l1);
    }

    public static void a(long l1, String s1, String s2, String s3)
    {
        JSONObject jsonobject = new JSONObject();
        try
        {
            jsonobject.put("update_ver", s1);
            jsonobject.put("old_ver", s2);
            jsonobject.put("way", s3);
        }
        catch(JSONException jsonexception)
        {
            jsonexception.printStackTrace();
        }
        f().a(jsonobject, "Softupgrade", l1);
    }

    public static void a(long l1, boolean flag)
    {
        JSONObject jsonobject = new JSONObject();
        if(!flag)
            break MISSING_BLOCK_LABEL_32;
        try
        {
            jsonobject.put("mode", "back");
        }
        catch(JSONException jsonexception)
        {
            jsonexception.printStackTrace();
        }
        f().a(jsonobject, "switch", l1);
        return;
        jsonobject.put("mode", "front");
        break MISSING_BLOCK_LABEL_21;
    }

    public static void a(Context context, cls_b b1, String s1, String s2, String s3, String s4)
    {
        cls_a a1 = f();
        if(!a1.y)
        {
            a1.p = context;
            a1.q = context.getPackageName();
            a1.r = s1;
            a1.s = s2;
            a1.t = s3;
            a1.u = s4;
            a1.v = d(context);
            a1.w = a(context);
            a1.x = e(context);
            a1.y = true;
            a1.a(b1);
        }
    }

    private void a(cls_b b1)
    {
        C = b1;
        if(b1 != null)
            F = b1.a();
        if(l != null)
        {
            com.nnee.stat.a.a a1 = com.nnee.stat.a.a.a(q, p(), aS);
            l.a(a1);
        }
    }

    public static void a(String s1)
    {
        F = s1;
        cls_a a1 = f();
        if(a1 != null && a1.C != null)
            a1.C.a(s1);
    }

    public static void a(String s1, long l1, long l2)
    {
        f().a(((JSONObject) (null)), s1, l1, l2);
    }

    public static void a(String s1, long l1, long l2, HashMap hashmap)
    {
        JSONObject jsonobject = new JSONObject();
        if(hashmap != null)
            try
            {
                java.util.Map.Entry entry;
                for(Iterator iterator = hashmap.entrySet().iterator(); iterator.hasNext(); jsonobject.put((String)entry.getKey(), entry.getValue()))
                    entry = (java.util.Map.Entry)iterator.next();

            }
            catch(JSONException jsonexception)
            {
                jsonexception.printStackTrace();
            }
        f().a(jsonobject, s1, l1, l2);
    }

    public static void a(String s1, String s2)
    {
        JSONObject jsonobject;
        jsonobject = new JSONObject();
        if(s1 == null)
            break MISSING_BLOCK_LABEL_20;
        jsonobject.put("options", s1);
        if(s2 != null)
            jsonobject.put("reason", s2);
_L2:
        f().a(jsonobject, "uninstall", -1L);
        return;
        JSONException jsonexception;
        jsonexception;
        jsonexception.printStackTrace();
        if(true) goto _L2; else goto _L1
_L1:
    }

    public static void a(String s1, String s2, String s3)
    {
        JSONObject jsonobject;
        jsonobject = new JSONObject();
        if(s1 == null)
            break MISSING_BLOCK_LABEL_20;
        jsonobject.put("curpage", s1);
        jsonobject.put("gopage", s2);
        if(s3 != null)
            jsonobject.put("ref", s3);
_L2:
        f().a(jsonobject, "Pagevisit", -1L);
        return;
        JSONException jsonexception;
        jsonexception;
        jsonexception.printStackTrace();
        if(true) goto _L2; else goto _L1
_L1:
    }

    public static void a(String s1, String s2, HashMap hashmap)
    {
        if(s1 != null && s2 != null) goto _L2; else goto _L1
_L1:
        return;
_L2:
        Long long1 = (Long)f().m.remove((new StringBuilder()).append(s1).append("_").append(s2).toString());
        if(long1 != null)
        {
            long l1 = o() - long1.longValue();
            JSONObject jsonobject = new JSONObject();
            if(hashmap != null)
                try
                {
                    java.util.Map.Entry entry;
                    for(Iterator iterator = hashmap.entrySet().iterator(); iterator.hasNext(); jsonobject.put((String)entry.getKey(), entry.getValue()))
                        entry = (java.util.Map.Entry)iterator.next();

                }
                catch(JSONException jsonexception)
                {
                    jsonexception.printStackTrace();
                }
     